//
//  ProgressView.m
//  mendianjieke
//
//  Created by 响当当 on 7/30/19.
//  Copyright © 2019 dongzheng. All rights reserved.
//

#import "ProgressView.h"

@interface ProgressView()

@end

@implementation ProgressView

- (void)getRealTimeFrame:(CGRect)frame
                    info:(NSArray *)infoArr
{
    self.frame = frame;
    
    NSInteger num = infoArr.count;
    
    if (num == 2)
    {
        UIView *pointView = [[UIView alloc]initWithFrame:CGRectMake(74*kUIScaleBasePlus,6*kUIScaleBasePlus,8*kUIScaleBasePlus,8*kUIScaleBasePlus)];
        pointView.backgroundColor = LCHexColor(0xFF7A17);
        pointView.layer.masksToBounds = YES;
        pointView.layer.cornerRadius = pointView.frame.size.width/2;
        [self addSubview:pointView];
        
        UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(pointView.frame),9*kUIScaleBasePlus,192*kUIScaleBasePlus,1*kUIScaleBasePlus)];
        lineView.backgroundColor = JSALineColor;
        [self addSubview:lineView];
        
        UILabel *titleLabel = [Utilties creatLabelWithFrame:CGRectMake(52*kUIScaleBasePlus,CGRectGetMaxY(pointView.frame)+10*kUIScaleBasePlus,60*kUIScaleBasePlus,20*kUIScaleBasePlus)
                                               textAligment:NSTextAlignmentCenter
                                                   textClor:LCHexColor(0x282828)
                                                   textFont:13*kUIScaleBasePlus];
        titleLabel.text = infoArr[0];
        [self addSubview:titleLabel];
        
        
        UIView *pointTwoView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(lineView.frame),6*kUIScaleBasePlus,8*kUIScaleBasePlus,8*kUIScaleBasePlus)];
        pointTwoView.backgroundColor = LCHexColor(0xFF7A17);
        pointTwoView.layer.masksToBounds = YES;
        pointTwoView.layer.cornerRadius = pointView.frame.size.width/2;
        [self addSubview:pointTwoView];
        
        UILabel *titleTwoLabel = [Utilties creatLabelWithFrame:CGRectMake(252*kUIScaleBasePlus,CGRectGetMaxY(pointView.frame)+10*kUIScaleBasePlus,60*kUIScaleBasePlus,20*kUIScaleBasePlus)
                                               textAligment:NSTextAlignmentCenter
                                                   textClor:LCHexColor(0x282828)
                                                   textFont:13*kUIScaleBasePlus];
        titleTwoLabel.text = infoArr[1];
        [self addSubview:titleTwoLabel];
        
    }
    else
    {
        UIView *pointView = [[UIView alloc]initWithFrame:CGRectMake(61*kUIScaleBasePlus,6*kUIScaleBasePlus,8*kUIScaleBasePlus,8*kUIScaleBasePlus)];
        pointView.backgroundColor = LCHexColor(0xFF7A17);
        pointView.layer.masksToBounds = YES;
        pointView.layer.cornerRadius = pointView.frame.size.width/2;
        [self addSubview:pointView];
        
        UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(pointView.frame),9*kUIScaleBasePlus,231*kUIScaleBasePlus,1*kUIScaleBasePlus)];
        lineView.backgroundColor = JSALineColor;
        [self addSubview:lineView];
        
        UILabel *titleLabel = [Utilties creatLabelWithFrame:CGRectMake(25*kUIScaleBasePlus,CGRectGetMaxY(pointView.frame)+10*kUIScaleBasePlus,80*kUIScaleBasePlus,20*kUIScaleBasePlus)
                                               textAligment:NSTextAlignmentCenter
                                                   textClor:LCHexColor(0x282828)
                                                   textFont:12*kUIScaleBasePlus];
        titleLabel.text = infoArr[0];
        [self addSubview:titleLabel];
        [titleLabel sizeToFit];

        
        UIView *pointTwoView = [[UIView alloc]initWithFrame:CGRectMake(184*kUIScaleBasePlus,6*kUIScaleBasePlus,8*kUIScaleBasePlus,8*kUIScaleBasePlus)];
        pointTwoView.backgroundColor = LCHexColor(0xFF7A17);
        pointTwoView.layer.masksToBounds = YES;
        pointTwoView.layer.cornerRadius = pointView.frame.size.width/2;
        [self addSubview:pointTwoView];
        
        UILabel *titleTwoLabel = [Utilties creatLabelWithFrame:CGRectMake(136*kUIScaleBasePlus,CGRectGetMaxY(pointView.frame)+10*kUIScaleBasePlus,80*kUIScaleBasePlus,20*kUIScaleBasePlus)
                                                  textAligment:NSTextAlignmentCenter
                                                      textClor:LCHexColor(0x282828)
                                                      textFont:12*kUIScaleBasePlus];
        titleTwoLabel.text = infoArr[1];
        [self addSubview:titleTwoLabel];
        [titleTwoLabel sizeToFit];
        
        UIView *pointThreeView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(lineView.frame),6*kUIScaleBasePlus,8*kUIScaleBasePlus,8*kUIScaleBasePlus)];
        pointThreeView.backgroundColor = LCHexColor(0xFF7A17);
        pointThreeView.layer.masksToBounds = YES;
        pointThreeView.layer.cornerRadius = pointView.frame.size.width/2;
        [self addSubview:pointThreeView];
        
        UILabel *titleThreeLabel = [Utilties creatLabelWithFrame:CGRectMake(CGRectGetMaxX(pointThreeView.frame)-40*kUIScaleBasePlus,CGRectGetMaxY(pointView.frame)+10*kUIScaleBasePlus,80*kUIScaleBasePlus,20*kUIScaleBasePlus)
                                                  textAligment:NSTextAlignmentCenter
                                                      textClor:LCHexColor(0x282828)
                                                      textFont:12*kUIScaleBasePlus];
        titleThreeLabel.text = infoArr[2];
        [self addSubview:titleThreeLabel];
        [titleThreeLabel sizeToFit];
        [titleThreeLabel setX:CGRectGetMaxX(pointThreeView.frame)-titleThreeLabel.frame.size.width/2];

    }
    
    
    
    
}

@end
